<%@page language="java" pageEncoding="UTF-8"%>
<%@include file="/views/common/include/taglib.jsp"%>
<link type="text/css" rel="stylesheet"
	href="${ctx }/css/dlifestyle/sectionparent.css" source="widget" />
<link type="text/css" rel="stylesheet"
	href="${ctx }/css/dlifestyle/admin.css" source="widget" />
<script
	src="${ctx}/js/controllers/mall/couponinfo/CouponInfoEditController.js"
	type="text/javascript"></script>
<section>
	<div style="height: 40px; line-height: 40px;">
		<div class="forword_area"></div>
		<div class="location">当前位置：${sessionScope.currcent_position}</div>
	</div>
	<hr>
	<div class="panel panel-default">
		<div class="editTitle">
			<div style="height: 41px; width: 190px; float: left;">
				<img style="float: left; margin-left: 37px; margin-top: 9.5px;"
					src="${ctx}/images/new_edit.png" />
				<h4>新增优惠券信息</h4>
			</div>
			<div>
				<a style="float: right; margin-right: 20px; margin-top: -2px;"
					title="关闭" onclick="cancel();"><img
					src="${ctx}/images/new_close.png" /></a>
			</div>
		</div>
		<div id="form" class="form">
			<div class="itemEdit">
				<label class="col-sm-1 editlableEdit">优惠券名称：</label>
				<div class="flEdit">
					<input id="couponInfoId" type="hidden" value="${couponInfo.id}">
					<input class="controlEdit" id="name" type="text"
						value="${couponInfo.name}" onblur="checkName()" style="width: 80%"
						class="text" maxlength="50" placeholder="请输入优惠券名称（最多50字）" /> <em
						class="emStyle">*</em>
				</div>
			</div>
			<div class="itemEdit">
				<span class="col-sm-1 editlableEdit">优惠券类型：</span>
				<div class="flEdit">
					<select class="controlEdit" id="type" onblur="checkType()" disabled="disabled"
						style="height: 29px; width: 140px" required>
						<option value="" >请选择优惠券类型</option>
						<option value="1">平台新人券</option>
						<option value="2">平台邀请券</option>
						<option value="3" selected="selected">满减券</option>
						<option value="4">免运费券</option>
					</select> <em class="emStyle">*</em>
				</div>
			</div>
			<div class="itemEdit">
				<span class="col-sm-1 editlableEdit">减免线：</span>
				<div class="flEdit">
					<input class="controlEdit" id="breakLine" onblur="checkBreakLine()"
						style="width: 16%" type="text" maxlength="10"
						value="${couponInfo.breakLine}" placeholder="请输入优惠券减免线" >
						<em class="emStyle">*</em>
				</div>
			</div>

			<div class="itemEdit">
				<span class="col-sm-1 editlableEdit">减免金额：</span>
				<div class="flEdit">
					<input class="controlEdit" id="breakPrice"
						onblur="checkBreakPrice()" style="width: 16%" type="text"
						maxlength="10" value="${couponInfo.breakPrice}" placeholder="请输入优惠券减免金额" >
						<em class="emStyle">*</em>
				</div>
			</div>
			<div class="itemEdit">
				<span class="col-sm-1 editlableEdit">领取有效期：</span>
				<div class="flEdit">
					<input class="controlEdit" style="width: 16%" id="beginDate"
						type="text" maxlength="20" class="input-sm"
						onblur="checkBeginDate()"
						onClick="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true,maxDate:'#F{$dp.$D(\'endDate\')}'})"
						value="${couponInfo.beginDate}" placeholder="开始时间"> <em
						class="emStyle">*</em><span
						style="margin-left: 30px; margin-right: 20px">至</span> <input
						class="controlEdit" style="width: 16%" id="endDate" type="text"
						maxlength="20" class="input-sm" onblur="checkEndDate()"
						onClick="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true,minDate:'#F{$dp.$D(\'beginDate\')}',startDate:'#F{$dp.$D(\'beginDate\',{d:+1})}'})"
						value="${couponInfo.endDate}" placeholder="结束时间"> 
						<em class="emStyle">*</em>
				</div>
			</div>
			<div class="itemEdit">
				<span class="col-sm-1 editlableEdit">使用有效期：</span>
				<div class="flEdit">
					<input class="controlEdit" style="width: 16%" id="useBeginDate"
						type="text" maxlength="20" class="input-sm"
						onblur="checkUseBeginDate()"
						onClick="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true,maxDate:'#F{$dp.$D(\'useEndDate\')}'})"
						value="${couponInfo.useBeginDate}" placeholder="开始时间"> <em
						class="emStyle">*</em><span
						style="margin-left: 30px; margin-right: 20px">至</span> <input
						class="controlEdit" style="width: 16%" id="useEndDate" type="text"
						maxlength="20" class="input-sm" onblur="checkUseEndDate()"
						onClick="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true,minDate:'#F{$dp.$D(\'useBeginDate\')}',startDate:'#F{$dp.$D(\'useBeginDate\',{d:+1})}'})"
						value="${couponInfo.useEndDate}" placeholder="结束时间"> <em
						class="emStyle">*</em>
				</div>
			</div>
			<div class="itemEdit">
				<span class="col-sm-1 editlableEdit">数量：</span>
				<div class="flEdit">
					<input class="controlEdit" id="count" onblur="checkCount()"
						type="text" style="width: 16%" maxlength="11"
						value="${couponInfo.count}" placeholder="请输入优惠券数量">
						<em class="emStyle">*</em>
				</div>
			</div>
			<div class="foot">
				<button class="buttonCancle" onclick="cancel();">取&nbsp;&nbsp;消</button>
				<button class="buttonEdit" onclick="saveCouponInfo();">保&nbsp;&nbsp;存</button>
			</div>
		</div>
		<%@include file="/views/common/footer.jsp"%>
	</div>
</section>
<script type="text/javascript">
	var ctx = '${ctx}';
	setCtx(ctx);
</script>
<!-- 解决ie 6 7 8 9不能显示placeholder的问题 -->
<script src="${ctx}/js/lib/jquery.JPlaceholder.js"></script>

